home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 008 / mandzoom.arc / DEMO.BAS next >
Encoding:
BASIC Source File  |  1985-11-25  |  2.2 KB  |  46 lines

  1. 5       'This program will only work on in the standard graphics color mode              and does not support the advanced features of the MANDELBROT EXPLORER           program, such as saving the screen and exit checks
  2. 7       '
  3. 10      SCREEN 1: KEY OFF
  4. 20      INPUT "What is the real part";ACORN#
  5. 30      INPUT "What is the imaginary part";BCORN#
  6. 40      INPUT "What is the length of the side";SIDE#
  7. 50      ROWS% = 200: SCRSCL = .9259             'scrscl is the pixel height to                                                   width ratio and is used to make                                                 the picture square
  8. 60      GOSUB 1200: CLS
  9. 70      FOR MR% = 1 TO ROWS%
  10. 80              FOR NC% = 1 TO COLS%
  11. 90                      GOSUB 1300
  12. 100                     COUNT% = 100: AZ# = 0: BZ# = 0: FLAG% = -1  'count% is                                                                       1000 in                                                                         .EXE files
  13. 110                     WHILE COUNT% <> 0 AND FLAG%
  14. 120                             COUNT% = COUNT% - 1
  15. 130                             GOSUB 1010
  16. 140                     WEND
  17. 150                     CLR% = INT(COUNT% / 34) + 1
  18. 160                     IF COUNT% = 0 THEN CLR% = 0
  19. 170                     PSET (NC% + 50,MR% - 1),CLR%
  20. 180             NEXT NC%
  21. 190     NEXT MR%
  22. 200     '
  23. 210     'AZ# is the real part of Z, BZ# is the imaginary part of Z
  24. 220     'AC# is the real part of C, BC# is the imaginary part of C
  25. 230     'Z# is the size of Z
  26. 998     END
  27. 999     '*****
  28. 1010    'main calculation routine
  29. 1020            NAZ# = AZ# * AZ# - BZ# * BZ# + AC#      'new value for AZ#
  30. 1030            BZ# = AZ# * BZ# * 2 + BC#               'new value for BZ#
  31. 1040            Z# = SQR(NAZ# * NAZ# + BZ# * BZ#)       'size of Z#
  32. 1070        AZ# = NAZ#
  33. 1090            LET FLAG% =  (Z# < 2)
  34. 1110    RETURN
  35. 1120    '*****
  36. 1200    'set up the co-ordinates and scale
  37. 1210            GAP# = SIDE# / ROWS%
  38. 1220            GAPN# = GAP# * SCRSCL!
  39. 1230            COLS% = ROWS% / SCRSCL!
  40. 1240    RETURN
  41. 1250    '*****
  42. 1300    'calculate the new constants
  43. 1310            AC# = GAPN# * NC% + ACORN#
  44. 1320            BC# = GAP# * (ROWS% - MR%) + BCORN#
  45. 1330    RETURN
  46.